package com.lsx143.wordcount.day2;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;

public class UnionTest {
    public static void main(String[] args) {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
        DataStreamSource<String> dss1 = env.fromCollection(Arrays.asList("Json", "Tom", "Perter", "Jerry"));
        DataStreamSource<String> dss2 = env.fromCollection(Arrays.asList("A", "B", "C", "D"));
        dss1.union(dss2)
                .print();
        try {
            env.execute();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
